from time import sleep
#导入启动包
from selenium import webdriver
#导入chrome服务(车)
from selenium.webdriver.chrome.service import Service
#导入一个定位元素工具 By (方向盘)
from selenium.webdriver.common.by import By

#车里装进去一个司机
service = Service(executable_path='../自动化下单流程/chromedriver.exe')
#司机发动Chrome这个车
driver = webdriver.Chrome(service=service)

#开启百度
driver.get('https://mail.163.com/')
#百度全屏
driver.maximize_window()
sleep(5)

"""
我需要做的事情
"""
frame = driver.find_element(By.TAG_NAME,'iframe')
driver.switch_to.frame(frame)
sleep(1)
driver.find_element(By.NAME,"email").send_keys('17319774151')
sleep(1)
driver.find_element(By.NAME,"password").send_keys('Dlh41882.')
sleep(0.5)
driver.find_element(By.ID,'dologin').click()
sleep(5)

driver.find_element(By.XPATH,'//div[contains(text(),"通讯录")]').click()
sleep(5)
# driver.quit()